package cn.south.campus.business.model.vo;

import cn.south.campus.business.model.entity.User;
import cn.south.campus.common.model.vo.BaseVO;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 *
 * </p>
 *
 * @author chow
 * @since 2024/11/13 10:18
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class UserVo extends BaseVO {
    private String nickname;
    private String password;
    private String phone;
    private String avatar;
    private Integer gender;

    public static UserVo convert(User user) {
        if (user == null) {
            return null;
        }
        UserVo userVo = new UserVo();
        userVo.setId(user.getId());
        userVo.setNickname(user.getNickname());
        userVo.setPhone(user.getPhone());
        userVo.setAvatar(user.getAvatar());
        userVo.setGender(user.getGender());
        return userVo;
    }
}
